<?php

namespace Admin\Controller;
use Think\Controller;


class AdminController extends Controller {
    public function __construct(){
        parent::__construct();
        if(!session('admin')){
            $this->error('你没有登录');
        }
        //获取待审核家长的数量
        $user = M('user');
        $where['status'] = 0;
        $where['type'] = 1;
        $tipnum['2'] = $user->where($where)->count();
        //获取待审核老师的数量
        unset($where);
        $where['status'] = 0;
        $where['type'] = 2;
        $tipnum['3'] = $user->where($where)->count();
        //获取待审核需求数量
        $requirement = M('requirement');
        unset($where);
        $where['user_id'] = 0;
        $where['verify'] = 0;
        $tipnum['4'] = $requirement->where($where)->count();
        //获取待审核订单数量
        $order_form = M('order_form');
        unset($where);
        $where['status'] = 1;
        $tipnum['5'] = $order_form->where($where)->count();
        //获取待审核订单数量
        unset($where);
        $where['status'] = 4;
        $tipnum['6'] = $order_form->where($where)->count();
        $this->assign('tipnum',$tipnum);
    }
    
    
    public function isExist($id){
        if(1){
            
        }
    }
    
    /*
     * 处理科目成字符串
     */
    public function lesson($data, $class){
        $lesson = require "./Application/Pub/Dictionaries/".$class.".php";
        $new_lesson = '';
        if(is_array($data)){            
            foreach($data as $k  => $v){
                $new_lesson .= $lesson[$v]."&nbsp";
            }
        }else{
            $new_lesson = $lesson[$data];
        }
        return $new_lesson;
        
        
    }
    
}